Component({
  /**
   * 组件的属性列表
   */
  properties: {
    selected: Number,
  },

  /**
   * 组件的初始数据
   */
  data: {
    listTab: [
      {
        pagePath: "/pages/home/home",
        text: "首页",
        iconPath: "/images/tabbar/home2.png",
        selectedIconPath: "/images/tabbar/home.png",
      },
      {
        text: "客服",
        iconPath: "/images/tabbar/fl.png",
        selectedIconPath: "/images/tabbar/fl2.png",
      },
      {
        pagePath: "/pages/login/login",
        text: "我的",
        iconPath: "/images/tabbar/my.png",
        selectedIconPath: "/images/tabbar/my2.png",
      },
    ],
  },

  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e) {
      const { path, index } = e.currentTarget.dataset;
      if (index !== 1) {
        wx.switchTab({ url: path });
      }
    },
  },
});
